-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Run puffin
and puffin_egui
on wasm32 on web
#112
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@TimonPost before approving and merging this, could you try it out on one of our wasm modules and verify it still compiles and works - just be to safe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could compile it for wasm-unknown-unknown, nice fix!
do you mean you tested it for one of our modules and saw that it worked in practice with profiling and what dependencies it added, or that you compiled |
Added it as a dependency, checked what deps it added with introduced feature flags, and validated our modules compile with the new dependencies. Which was the first part of the suggestion, tho the second 'working' part needs some more work. I will have to take some more time to validate that. |
Seems to still run fine :) |
This dependency was introduced originally in #112. It is a platform abstraction, but it is a tiny one and it is not harder to just use the std type which avoids always pulling in `instant` including for `wasm32-unknown-unknown` when not building for the web where it has no purpose at all. Want to have as few dependencies as possible on core low level crates like `puffin` that almost all of our code depends on.
This dependency was introduced originally in #112. It is a platform abstraction, but it is a tiny one and it is not harder to just use the std type which avoids always pulling in `instant` including for `wasm32-unknown-unknown` when not building for the web where it has no purpose at all. Want to have as few dependencies as possible on core low level crates like `puffin` that almost all of our code depends on. --------- Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
) This dependency was introduced originally in EmbarkStudios#112. It is a platform abstraction, but it is a tiny one and it is not harder to just use the std type which avoids always pulling in `instant` including for `wasm32-unknown-unknown` when not building for the web where it has no purpose at all. Want to have as few dependencies as possible on core low level crates like `puffin` that almost all of our code depends on. --------- Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
Checklist
Description of Changes
This makes
puffin
andpuffin_egui
compile and run on wasm32 compiled for web if you enable the "web" feature.The timer resolution on web sucks - it is only 1 ms due to meltdown/spectre mitigation, but having the same code compile and run on both native and web is quite nice regardless.
I tested this by quickly hacking in to my
eframe_template
project, and it works!